import SelectUtil from '@/SelectUtil';
import UnitCommon from 'code/Core/Common/UnitCommon';
import AbilityBase from 'code/Scripts/Abilities/base/AbilityBase';
/**
 * 锚击
 **/
export default class MSK_MaoJi extends AbilityBase {
    static instance: MSK_MaoJi;
    constructor(id: string = 'Mht0') {
        super(id);
        MSK_MaoJi.instance = this;
        this.init();
        se.onUnitSpellEffect(this.onSpellEffect.bind(this), this.id);
    }
    init() {}
    cast<T extends Object = any>(tarX: number, tarY: number, source: unit, target: unit, data?: T): void {
        SetUnitAnimation(source, 'attack slam');
        let es = SelectUtil.getEnemyUnitsInRange(source, 225);
        let dmg = UnitCommon.取攻击(source) * 10;
        for (let e of es) {
            DamageSystemInstance.applyAttackDamage(e, source, dmg);
        }
    }
    onSpellEffect() {
        this.cast(GetSpellTargetX(), GetSpellTargetY(), GetTriggerUnit(), GetSpellTargetUnit());
    }
}
